# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-color-output
_pkgname=Color-Output
pkgver=1.05
pkgrel=13
pkgdesc='Module to give color to the output.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
url='http://search.cpan.org/~animator/Color-Output-1.05/Output.pm'
source=("http://search.cpan.org/CPAN/authors/id/A/AN/ANIMATOR/$_pkgname-$pkgver.tar.gz")
sha512sums=('7d8ed9c0ce091d807e105c7212cb663e77c887279a1133c183092d91cfc66a0af27e9fb1d523577b9bf9f362d3591347acbcf2d2ac7eb3cdd3916d26d222d890')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
    PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null
}

build() {
  cd "$_pkgname-$pkgver"

  perl Makefile.PL

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

